<%@ page language="java" import="dao.*" pageEncoding="UTF-8" %>
 <%@ page language="java" import="java.util.*" %>
 <%@page import="util.*" %>
<%
String orderId = Request.get("order", "id");
String sortId = Request.get("sort", "desc");
util.Execl xls = new util.Execl();
xls.addCol("id", "ID");

xls.addCol("kechengbianhao", "课程编号");

xls.addCol("kechengmingcheng", "课程名称");

xls.addColSelect("kemu", "科目", "kemuxinxi", "id", "kemumingcheng", 0);

xls.addCol("xuefen", "学分");

xls.addCol("shangkedidian", "上课地点");

xls.addCol("kechengjieshao", "课程介绍");

xls.addCol("fabujiaoshi", "发布教师");

// 下面是数据，数据需要经过处理
String where = " 1=1 ";

if (request.getParameter("kechengbianhao") != null && !"".equals(request.getParameter("kechengbianhao"))) {
    where += " AND kechengbianhao LIKE '%" + request.getParameter("kechengbianhao") + "%'";
}
if (request.getParameter("kechengmingcheng") != null && !"".equals(request.getParameter("kechengmingcheng"))) {
    where += " AND kechengmingcheng LIKE '%" + request.getParameter("kechengmingcheng") + "%'";
}
List<Map> list = Query.make("kechengxinxi").where(where).order(orderId + " " + sortId).select();

xls.addData(list);
xls.export("kechengxinxi", response);
%>

